package com.inspur.demo.config;

import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 *    
 * 配置
 *
 * @desc:
 * @author: li.peng02
 * @date: 2019/2/28
 * @version: v1.0 
 */
@Configuration
public class ApplicationConfig {

    //@Bean
    //@LoadBalanced
    //RestTemplate restTemplate() {
    //    return new RestTemplate();
    //}

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(RestTemplateBuilder builder) {
        return builder.build();
    }

}
